/*
** Lua binding: objscript
** Generated automatically by tolua++-1.0.92 on Fri Jan 28 22:29:33 2011.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_objscript_open (lua_State* tolua_S);

#include "lua/lua_pixelobj.hpp"

/* function to release collected object via destructor */
#ifdef __cplusplus

static int tolua_collect_pm3__PIXELOBJ (lua_State* tolua_S)
{
 pm3::PIXELOBJ* self = (pm3::PIXELOBJ*) tolua_tousertype(tolua_S,1,0);
	delete self;
	return 0;
}
#endif


/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"pm3::PIXELOBJ");
}

/* method: new of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_new00
static int tolua_objscript_pm3_OBJ_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELOBJ* tolua_ret = (pm3::PIXELOBJ*)  new pm3::PIXELOBJ();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"pm3::PIXELOBJ");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_new00_local
static int tolua_objscript_pm3_OBJ_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELOBJ* tolua_ret = (pm3::PIXELOBJ*)  new pm3::PIXELOBJ();
   tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"pm3::PIXELOBJ");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: delete of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_delete00
static int tolua_objscript_pm3_OBJ_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELOBJ* self = (pm3::PIXELOBJ*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
  delete self;
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: get_tags of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_get_tags00
static int tolua_objscript_pm3_OBJ_get_tags00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"const pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const pm3::PIXELOBJ* self = (const pm3::PIXELOBJ*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_tags'",NULL);
#endif
  {
   std::string tolua_ret = (std::string)  self->get_tags();
   tolua_pushcppstring(tolua_S,(const char*)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_tags'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: add_tags of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_add_tags00
static int tolua_objscript_pm3_OBJ_add_tags00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELOBJ* self = (pm3::PIXELOBJ*)  tolua_tousertype(tolua_S,1,0);
  const std::string r_tags = ((const std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'add_tags'",NULL);
#endif
  {
   self->add_tags(r_tags);
   tolua_pushcppstring(tolua_S,(const char*)r_tags);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'add_tags'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: remove_tags of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_remove_tags00
static int tolua_objscript_pm3_OBJ_remove_tags00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELOBJ* self = (pm3::PIXELOBJ*)  tolua_tousertype(tolua_S,1,0);
  const std::string r_tags = ((const std::string)  tolua_tocppstring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'remove_tags'",NULL);
#endif
  {
   self->remove_tags(r_tags);
   tolua_pushcppstring(tolua_S,(const char*)r_tags);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'remove_tags'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: get_directions of class  pm3::PIXELOBJ */
#ifndef TOLUA_DISABLE_tolua_objscript_pm3_OBJ_get_directions00
static int tolua_objscript_pm3_OBJ_get_directions00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"const pm3::PIXELOBJ",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const pm3::PIXELOBJ* self = (const pm3::PIXELOBJ*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_directions'",NULL);
#endif
  {
   int tolua_ret = (int)  self->get_directions();
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_directions'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: pm3::lua::get_active_object */
#ifndef TOLUA_DISABLE_tolua_objscript_get_active_object00
static int tolua_objscript_get_active_object00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnoobj(tolua_S,1,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELOBJ* tolua_ret = (pm3::PIXELOBJ*)  pm3::lua::get_active_object();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"pm3::PIXELOBJ");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_active_object'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_objscript_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
  tolua_module(tolua_S,"pm3",0);
  tolua_beginmodule(tolua_S,"pm3");
   #ifdef __cplusplus
   tolua_cclass(tolua_S,"OBJ","pm3::PIXELOBJ","",tolua_collect_pm3__PIXELOBJ);
   #else
   tolua_cclass(tolua_S,"OBJ","pm3::PIXELOBJ","",NULL);
   #endif
   tolua_beginmodule(tolua_S,"OBJ");
    tolua_function(tolua_S,"new",tolua_objscript_pm3_OBJ_new00);
    tolua_function(tolua_S,"new_local",tolua_objscript_pm3_OBJ_new00_local);
    tolua_function(tolua_S,".call",tolua_objscript_pm3_OBJ_new00_local);
    tolua_function(tolua_S,"delete",tolua_objscript_pm3_OBJ_delete00);
    tolua_function(tolua_S,"get_tags",tolua_objscript_pm3_OBJ_get_tags00);
    tolua_function(tolua_S,"add_tags",tolua_objscript_pm3_OBJ_add_tags00);
    tolua_function(tolua_S,"remove_tags",tolua_objscript_pm3_OBJ_remove_tags00);
    tolua_function(tolua_S,"get_directions",tolua_objscript_pm3_OBJ_get_directions00);
   tolua_endmodule(tolua_S);
  tolua_endmodule(tolua_S);
  tolua_function(tolua_S,"get_active_object",tolua_objscript_get_active_object00);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_objscript (lua_State* tolua_S) {
 return tolua_objscript_open(tolua_S);
};
#endif

